package com.itheima.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.itheima.mapper.OperateLogMapper;
import com.itheima.pojo.OperateLog;
import com.itheima.pojo.PageBean;
import com.itheima.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Description: LogServiceImpl
 * @Author: HH
 * @Date: 2025/4/29 10:12
 **/
@Service
public class LogServiceImpl implements LogService {
    @Autowired
    private OperateLogMapper operateLogMapper;
    /**
     * 分页查询日志信息
     */
    @Override
    public PageBean page(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        Page<OperateLog> logList = operateLogMapper.page();
        return new PageBean(logList.getTotal(), logList.getResult());
    }
}
